package com.wuyoucar.controller;

import com.wuyoucar.common.ResultBean;
import com.wuyoucar.entity.TSafetype;
import com.wuyoucar.entity.TSafetypeitem;
import com.wuyoucar.service.TSafetypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.LinkedHashMap;
import java.util.List;

@RestController
@RequestMapping("/consumer")
public class TSafetypeController {

    @Autowired
    private TSafetypeService tSafetypeService;

    //查询所有险种信息
    @RequestMapping("/allrisks")
    public List<TSafetype> getAllTSafetype(){
        return tSafetypeService.getAllTSafetype();
    }

    //查询具体险种信息
    @RequestMapping("/AllSafeTypeItem")
    public List<TSafetypeitem> getAllTSafetypeitem(){
        return tSafetypeService.getAllTSafetypeitem();
    }

    @RequestMapping("/FillinVehicleiFnormation")
    public ResultBean FillinVehicleiFnormation(@RequestBody LinkedHashMap<String,String> mymap){
        return tSafetypeService.FillinVehicleiFnormation(mymap);
    }

    //查询单个险种信息
    @RequestMapping("/getAllTSafetypeByid")
    public ResultBean getAllTSafetypeByid(Integer safetypeid){
        return tSafetypeService.getAllTSafetypeByid(safetypeid);
    }
}
